package com.myspring.service.impl;

import com.myspring.config.SpringConfig;
import com.myspring.po.Product;
import com.myspring.utils.TranscationProxyFactory;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;

import static org.junit.jupiter.api.Assertions.*;
/**
* ClassName: ProductServiceImplTest02
* Package: com.myspring.service.impl
* Description:
* @Author 刘英杰
* @Create 2025/2/4 16:34
* @Version 1.0
*/

@SpringJUnitConfig(SpringConfig.class)
class ProductServiceImplTest02 {

    @Autowired
    ProductServiceImpl02 productServiceImpl02;

    @Autowired
    TranscationProxyFactory transcationProxyFactory;

    @Test
    void updateProduct() {
        ProductServiceImpl02 proxyInstance = (ProductServiceImpl02) transcationProxyFactory.createProxyInstance(ProductServiceImpl02.class);
        proxyInstance.updateProduct(new Product(13,"索尼单反相机",19999.00,"数码相机"));
    }
}